package com.whims.replaceFinalizer;

import java.util.HashMap;

/**
 * 替换终结器
 */
public class CleanupExample {

    private CleanupFinalizer cf;
    private HashMap data = new HashMap();
    public CleanupExample() {
        cf = new CleanupFinalizer(this);
    }

    //……向hashmap中填东西的方法……
    public void close() {
        data = null;
        cf.setClosed();
    }

}
